package sim1011.starter;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Logger {
	
	private static FileWriter logFileWriter;
	private static DateFormat dateFormat;
	
	public static void inizializeFileWriter() throws IOException{
		logFileWriter = new FileWriter(new File("log/log.txt"));
		dateFormat = new SimpleDateFormat("hh:mm:ss:SSS");
	}
	
	
	public static void log(String message) {
		/*try {
			//System.out.println("[" + dateFormat.format(new Date()) + "] " + message);
			logFileWriter.append("[" + dateFormat.format(new Date()) + "] " + message+"\n");
			logFileWriter.flush();
		} catch (IOException e) {			
			e.printStackTrace();
		}*/		
	}
	
	public static void logPolicy(String message) {
		/*try {
			System.out.println("[" + dateFormat.format(new Date()) + "] " + message);
			logFileWriter.append("[" + dateFormat.format(new Date()) + "] " + message+"\n");
			logFileWriter.flush();
		} catch (IOException e) {			
			e.printStackTrace();
		}*/
	}
}
